<!DOCTYPE html>
<html lang="zh-CN">

<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>员工管理</title>
	[#include "/admin/common/commons.html"]
	[#include "/tenant/common/site.html"]
	[#include "/tenant/admin/employee/componentAdd.html"]
	[#include "/tenant/admin/employee/componentList.html"]
	[#include "/tenant/admin/employee/componentUpdate.html"]
	[#include "/tenant/admin/employee/componentShow.html"]
	[#include "/tenant/admin/employee/componentAccount.html"]
	[#include "/tenant/admin/employee/componentRestPassword.html"]

	[@baseHead /]
	<script type="text/javascript"></script>

	<style>
		.goods_content_l .tree {
			background-color: #f9f9f9;
			height: 100%;
			padding: 10px 0;
		}

		.goods_content_l .title {
			line-height: 40px;
			cursor: pointer;
			display: block;
			background-color: #f9f9f9;
			margin-bottom: 10px;
			padding-left: 20px;
		}

		.goods_content_l .title i {
			float: right;
			margin: 14px;
		}

		.goods_content_l .el-tree {
			background-color: transparent;
		}

		.goods_content_l .el-tree .el-tree-node__label {
			font-size: 13px;
			font-weight: bold;
		}

		.goods_content_l .el-tree-node {
			margin: 5px 0;
		}

		.goods_content_l .el-tree-node__content:hover {
			background-color: #f9f9f9;
		}

		.el-tree-node__content {
			padding: 0 10px !important;
		}

		.el-tree-node__content>label.el-checkbox {
			position: absolute;
			right: 15px;
		}

		.is-current>.el-tree-node__content {
			background-color: #2984EF !important;
			color: #fff;
		}

		.custom-tree-node i {
			position: absolute;
			right: 14px;
			display: none;
			overflow: hidden;
		}

		.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content i {
			display: inline-block;
		}

		.department {
			line-height: 40px;
		}

		.right-content {
			padding-left: 15px;
			border-left: solid 1px #E6E8EE;
		}

		.el-table td {
			padding: 5px 0px;
		}
		.el-cascader{
			width: 100%;
		}
	</style>
</head>

<body class="hold-transition skin-blue sidebar-mini">
	<!-- Site wrapper -->
	<div class="wrapper">

		<header class="main-header">
			<!-- Header Navbar: style can be found in header.less -->
			[#include "/admin/common/nav.html"]
		</header>

		<!-- =============================================== -->

		<!-- Left side column. contains the sidebar -->
		<aside class="main-sidebar">
			<!-- sidebar: style can be found in sidebar.less -->
			<section class="sidebar">
				[@user_panel /]
				<!-- search form -->
				[@sidebar_form /]
				<!-- /.search form -->
				<!-- sidebar menu: : style can be found in sidebar.less -->
				<ul class="sidebar-menu" data-widget="tree">
					<li class="header">主面板</li>
					[@menustag id=1]
					[#list list as item]
					[@menu item "1,27,55"]
					[/@menu]
					[/#list]
					[/@menustag]
				</ul>
			</section>
			<!-- /.sidebar -->
		</aside>

		<!-- =============================================== -->

		<!-- Content Wrapper. Contains page content -->
		<div class="content-wrapper" id="app" v-cloak>
			<!-- Content Header (Page header) -->
			<section class="content-header">
				<!-- 导航 -->
				<div class="navigation">
					<i>首页</i> <span>员工管理</span>
				</div>
			</section>
			<!-- Main content -->
			<section class="content">
				<keep-alive>
					<router-view v-if="$route.meta.keepAlive">
					</router-view>
				</keep-alive>
				<router-view v-if="!$route.meta.keepAlive">
				</router-view>
				<!-- Default box -->
			</section>


			<!-- /.content -->
		</div>
		<!-- /.content-wrapper -->

		[#include "/admin/common/footer.html"]

		<!-- Control Sidebar -->
		[#include "/admin/common/aside.html"]

		<!-- /.control-sidebar -->
		<!-- Add the sidebar's background. This div must be placed
     immediately after the control sidebar -->
		<div class="control-sidebar-bg"></div>
	</div>
	<!-- ./wrapper -->
	[@baseScript /]
	[#include "/tenant/common/component.html" /]



	[@avatar /]
	<script type="text/javascript">
		var config = {};

		config.methods = {};

		[@configBasicVue /]

		config.methods.goBack = function () {
			this.$router.go(-1);
		}
		config.basicMethod = function () {
			var result = {};
			result.postData = config.methods.postData;
			result.postJsonData = config.methods.postJsonData;
			result.goBack = config.methods.goBack;
			return result;
		}

		config.methods.loadOrgOptions = function () {
			var self = this;
			var param = {};
			param.sortMethod = "asc";
			param.sortField = "id";
			param.level = 1;
			param.size = 500;
			param.fetch = 1;
			$.post("${siteurl}tenantRest/organization/list.htm", param, function (result) {
				if (result.code == 0) {
					self.$store.commit('updateOrgOptions', result.list);
				}
			});
		}


	</script>



	[@employeeAddConfig /]
	[@employeeListConfig /]
	[@staffShowConfig /]
	[@employeeUpdateConfig /]
    [@childStaffConfig  /] 
	[@accountListConfig /]
	[@restPasswordConfig /]

	<script type="text/javascript">
		// 3. 创建 router 实例，然后传 `routes` 配置
		// 你还可以传别的配置参数, 不过先这么简单着吧。
		var appConfig = {};
		appConfig.el = "#app";


		const routes = [
			{
				path: '/view', name: "staffShowView", component: staffShowView, props: true, children: [
					{ path: "/view/index", name: "childStaffShowView", component: childStaffShowView },
					{ path: "/", component: childStaffShowView },
					{ path: "/account", component: accountListView },
					{ path: "/restPassword", component: restPasswordView }
				]
			}, 
			{ path: '/add', name: "employeeAddView", component: employeeAddView, props: true },
			{ path: '/update', name: "employeeUpdateView", component: employeeUpdateView, props: true },
			{
				path: '/', name: "employeeListView", component: employeeListView, props: true, meta: {
					keepAlive: true, //此组件不需要被缓存
				}
			}
		]



		const router = new VueRouter({
			routes: routes // (缩写) 相当于 routes: routes
		})

		var store = new Vuex.Store({
			state: {
				count: 0,
				orgOptions: [],
			},
			mutations: {
				increment: function (state) {
					state.count++
				},
				updateOrgOptions: function (state, obj) {
					state.orgOptions = obj;
				},

			}
		})

		appConfig.router = router;

		appConfig.store = store;
		appConfig.methods = config.methods;
		appConfig.mounted = function () {
			this.loadOrgOptions();
		}
		var vm = new Vue(appConfig);

	</script>

</body>

</html>